<template>
  <div>
<h1>要买的数量:{{msg}}</h1>
<!-- 定义点击增加事件add和odd -->
<button @click="add">增加</button> <button @click="odd">减少</button>
  </div>
</template>

<script>
export default {
  name: 'VueJobApp',

  data() {
    return {
      msg:0
    };
  },

  mounted() {
    
  },

  methods: {
    add(){
      // 点击增加让msg自增
      this.msg++;
    },
    odd(){
      // 点击减少让msg自增
      this.msg--;
    }
  },
};
</script>

<style lang="scss" scoped>

</style>